<template>
	<b-layout-index>
		<theme-color-bg type="c3">
			<navbar isStyle="light"></navbar>
			<view class="header">

				<u-row>
					<u-col span="6">
						<view class="qiandao" @click="getSign">签到</view>
					</u-col>

					<u-col span="6">
						<view class="items text-center mg-top-20">
							<view class="item pd-bottom-10">
								<view><text class="font-size-16">{{info.count}}</text><text class="font-size-14">次</text></view>
								<view><text class="font-size-12">连续签到</text></view>
							</view>
							<view class="item pd-bottom-10">
								<view><text class="font-size-16">{{info.integral}}</text><text class="font-size-14">次</text></view>
								<view><text class="font-size-12">总积分</text></view>
							</view>
						</view>
					</u-col>


				</u-row>

			</view>
		</theme-color-bg>
		<view class="mgm50">
			<view class="pd-left-10 pd-right-10  mg-bottom-10 mg-top-10">
				<base-panel-title :isRadius="true" :fill="true">
					<view class="pd-bottom-10 pd-top-10">
						<qiandao :items="datelist" />
					</view>
				</base-panel-title>
			</view>
		</view>
	</b-layout-index>
</template>

<script>
	import {
		findBySign,findBySignList
	} from "@/api/userWallet.js"
	export default {
		data() {
			return {
datelist:[],
info:{}
			}
		},onLoad:function (){
		this.getSignList()	
		},
		methods: {
			getSign() {
				var the=this;
				findBySign().then(res => {
					console.log(res)
							the.getSignList()	
							the.$u.toast("签到成功")
				})
			},getSignList(){
				var the=this
				//findBySignList
				findBySignList().then(res=>{
				//	console.log(res)
				var data=res.data;
				var dd={}
				for (var i = 0; i < data.length; i++) {
					var a=data[i]
					dd[a]=a;
				}
				the.info=res;
					the.datelist=dd
				})
				
			}
		}
	}
</script>

<style>
	.header {
		height: 200px;
	}

	.mgm50 {
		margin-top: -50px;
	}

	.qiandao {
		height: 70px;
		width: 70px;
		background-color: #FFFFFF;
		border-radius: 100%;
		margin: 0 auto;
		margin-top: 30px;
		text-align: center;
		line-height: 70px;
		font-weight: bold;
		border: #006DDD 5px solid;

	}

	.items {
		color: #FFFFFF;
	}
</style>
